package com.itheima.ssm.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BCryptPasswordEncoderUtils {

    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();

    public static String encodePassword(String password){
        String encode = bCryptPasswordEncoder.encode(password);
        return encode;
    }

    public static void main(String[] args){
        String password = "123";
        String pwd = encodePassword(password);
        //密文:$2a$10$CrkY9sZZYW0bvUfne2JbbObdA07UakcnyPdpoHa90HjeuBWgqgJ3a
        System.out.println(pwd);
    }
}
